package org.puremvc.as3.multicore.patterns.facade
{
	import org.puremvc.as3.multicore.core.ReView;
	import org.puremvc.as3.multicore.interfaces.IFacade;
	import org.puremvc.as3.multicore.patterns.command.EchoMessagingCommand;
	
	public class DummyFacade extends ReFacade implements IFacade
	{
		public static const EXTERNAL_ECHO_MESSAGE:String = 'EXTERNAL_ECHO_MESSAGE';
		
		public function DummyFacade(key:String)
		{
			super(key);
		}
		/**
		 * Facade Multiton Factory method
		 * 
		 * @return the Multiton instance of the Facade
		 */
		public static function getInstance( key:String ):DummyFacade {
			if (instanceMap[ key ] == null ) 
				instanceMap[ key ] = new DummyFacade( key );
			return instanceMap[ key ];
		}
		
		override protected function initializeMessaging():void {
			super.initializeMessaging();
			
			registerMessageCommand(EXTERNAL_ECHO_MESSAGE, EchoMessagingCommand); 
		} 
		
		public function hasReView():Boolean {
			return view is ReView;
		}
		
		public function getMessageKey():String {
			return messaging.key;
		}
		
	}
}